import request from '@/utils/request'

export default {
  //请求列表
  getChapterAndvideoByCourseId(courseId) {
    return request({
      url: "/eduservice/chapter/getChapterAndVideoByCourseId",
      method: 'get',
      params: {
        courseId: courseId
      }
    })
  },
  //新增或更新章节
  addOrUpdateChapter(chapterDao){
    return request({
      url: "/eduservice/chapter/addOrUpdateChapter",
      method: 'POST',
      data: {
        ...chapterDao
      }
    })
  },
  //删除章节
  deleteChapter(chapterId){
    return request({
      url: `/eduservice/chapter/deleteChapter/${chapterId}`,
      method: 'DELETE',
    })
  }
}

